﻿package j.sus2maj7.util
{
	
	public class StringBuilder
	{
		
		private var _array:Array;
	
		public function StringBuilder()
		{
			this._array = [];
		}
		
		public function append(string:String):StringBuilder
		{
			this._array.push(string);
			return this;
		}
		/*
		public function appendFormat(string:String, ...arguments):StringBuilder
		{
			this._array.push(StringBuilder.formatString(string, arguments));
			return this;
		}
		
		public static function formatString(...arguments):String
		{
			var len:int = arguments.length;
			if(len<1) return "";
			else if(len==1) return arguments[0];
			
			var str:String = arguments[0];
			var arrData:Array;
			if(typeof(arguments[1]) == "object"){
				arrData = arguments[1];
			}else{
				arrData = new Array();
				for(var j:uint = 1; j < arguments.length; j++){
					arrData.push( arguments[j] );
				}
			}
		
			for(var i:uint = 0; i < arrData.length; i++){
				str = str.split("{"+i+"}").join(arrData[i]);
			}
			return str;
		}//*/
		
		public function toString():String
		{
			return this._array.join("");
		}
			
	}
	
}